<%@language=vbscript%>
 <%
	Session("bChucnang")=4
	Session("FormName")="F23"
%>
<!--#include file="..\CheckSession.inc"-->
<!--#include file="..\RootContent.inc"-->
<!--#include file=..\getFormName.inc-->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>VĂN BẢN NỘI BỘ</title>
</head>
<%	
	Dim Msg
	bComm=Request("bComm")	
	bDangky=request("bDangky")
	backform=request("backform")+1
	if bComm="edit" then
		bSoghinhan=Request("TxtSoghinhan")
		bID=Request("bID")
		sSQL="Select * from VTNoibo Where IDNoibo Like '"& bID &"'"
		Set RecT=Server.CreateObject("ADODB.Recordset")
		RecT.CursorType=3
		RecT.CacheSize=5
		RecT.Open sSQL,Conn
		Dim bDisplay
		bDisplay=False
		if RecT.RecordCount>0 then
			dim bSoghinhan
			Dim bSogoccu
			bSoghinhan=RecT("soghinhan")	
			bSoghinhancu=RecT("soghinhan")	
			bID=RecT("IDNoibo")
			bTrichyeu=RecT("Trichyeu")
			bTentep=RecT("Tentep")
			bTentepcu=RecT("Tentep")
			bNgaytao=RecT("Ngayky")
			bNguoitao=RecT("Nguoiky")
			bDiachiluutru=RecT("Diachiluutru")
			bTukhoa=RecT("Tukhoa")
			bQuyen=RecT("Quyen")
			bTrangthai=RecT("Trangthai")			
			bDisplay=true
			bThoihan=RecT("Thoihan")
			bVinhvien=RecT("Vinhvien")		
			bNam=year(RecT("Ngayky"))		
			bNamcu=year(RecT("Ngayky"))			
		else
			'Response.Redirect("frmdsvtNoibo.asp?Chuachon=thongtin")
		end if
	end if
	Dim bTonTai
	if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then
		Select case bComm
			case "okedit"
				bSoghinhan=trim(Request("TxtSoghinhan"))
				bSoghinhancu=trim(Request("bSoghinhancu"))
				if KTSoghinhan(bSoghinhan,"okedit") then
					Msg="M&#227; s&#7889; ghi nh&#7853;n &#273;&#227; t&#7891;n t&#7841;i"
					bTontai=True
					bDisplay=true
					bComm="edit"				
					'bIDcu=request("bIDcu")
				else
					'Msg="N&#7897;i dung &#273;&#227; &#273;&#432;&#7907;c s&#7917;a"
					bTonTai=false
					bComm="edit"
				end if
				bID=Request("bID")
				'Msg="N&#7897;i dung &#273;&#227; &#273;&#432;&#7907;c s&#7917;a"
				'bTonTai=false
				'bComm="edit"
				bTrichyeu=trim(Request("TxtTrichyeu"))
				bNguoitao=trim(Request("TxtNguoitao"))
				bNgaytao=request("TxtNgayTao")
				bNam=year(request("TxtNgayTao"))
				bTukhoa=trim(Request("TxtTukhoa"))
				bTrangthai=Request("bTrangthai")
				if bTrangthai then
					bTrangthai=1
				else
					bTrangthai=0
				end if
				bQuyen=Request("bQuyen")
				if bQuyen then
					bQuyen=1
				else
					bQuyen=0
				end if
				bVinhvien=Request("RButton")			
				bThoihan=request("TxtThoihan")
				if bVinhvien<>"" then
					bVinhvien=1
					bThoihan=Savedate(bThoihan)
				else
					bVinhvien=0				
				end if			
				'bSoghinhancu=Request("bSoghinhancu")
'				bDiachiluutru=trim(Request("TxtDiachiluutru"))
				bDiachiluutru=0
				if Request("filename")<>"" then
					bTentepcu=Request("filename")
				end if
				bNamcu=Request("bNamcu")
				bNgayTao=SaveDate(bNgaytao)
				On Error Resume Next
				if not bTontai then
					if bVinhvien then
						sSQL="Update VTNoibo set ngayky='"& bNgaytao _
							&"',Nguoiky='"& bNguoitao _
							&"',Trichyeu='"& ModiString(bTrichyeu) _
							&"',Tukhoa='"& ModiString(bTukhoa) _
							&"',Quyen="& bQuyen _
							&",Vinhvien="& bVinhvien _
							&",Thoihan='"& bThoihan _
							&"',Soghinhan='"& bSoghinhan _
							&"',Diachiluutru='"& ModiString(bDiachiluutru) _
							&"',Trangthai="& bTrangthai	&" Where IDNoibo ='"& bID &"'" 
					else
						sSQL="Update VTNoibo set ngayky='"& bNgaytao _
							&"',Nguoiky='"& bNguoitao _
							&"',Trichyeu='"& ModiString(bTrichyeu) _
							&"',Tukhoa='"& ModiString(bTukhoa) _
							&"',Quyen="& bQuyen _
							&",Soghinhan='"& bSoghinhan _
							&"',Thoihan=NULL,Vinhvien="& bVinhvien _
							&",Diachiluutru='"& ModiString(bDiachiluutru) _
							&"',Trangthai="& bTrangthai	&" Where IDNoibo ='"& bID &"'"
					end if
					Conn.Execute sSQL
					sSQL="Update Muontra set BophanQL="& bDiachiluutru &",matailieu = '"& bSoghinhan &"' where matailieu like '"& bSoghinhancu &"' and Loaitailieu=3"
					Conn.Execute sSQL 
					sSQL="Update Quyen set mavanthu='"& ModiString(bSoghinhan) &"' where mavanthu Like '"& bSoghinhancu &"' and maloaivanthu='3'" 				
					Conn.Execute sSQL
					sSQL="Update Quyen_nhom set mavanthu='"& ModiString(bSoghinhan) &"' where mavanthu Like '"& bSoghinhancu &"' and maloaivanthu='3'" 				
					Conn.Execute sSQL
					bOKUpdate=false
					if cstr(bNam)=cstr(bNamcu) then
						bOKUpdate=true
					end if
					if not bOKUpdate then
						'Sua File
						set TextFile=server.CreateObject("Activefile.file")
						PathOld=RootContent & "Upload\"& cstr(bNamcu) &"\Noibo\Text"
						PathOld=Pathold & "\" & bID & ".VT" 
						Path=RootContent & "Upload\"& cstr(bNam) &"\Noibo\Text"
						Path=Path & "\" & bID & ".VT" 	
					
						'Tao thu muc nam moi
						Set bDir=server.CreateObject("ActiveFile.Directory")
						 bPathFolder=RootContent & "Upload" & "\" & bNam
						bDir.Path=bPathFolder
						if not bDir.Exists() then
							call bDir.Create(bPathFolder)
						end if
						bPathFolder=bPathFolder & "\noibo"
						bDir.Path=bPathFolder
						if not bDir.Exists() then
							Call bDir.Create(bPathFolder)
						end if
							bPathFolder=bPathFolder & "\Text"
							bDir.Path=bPathFolder
							if not bDir.Exists() then
								Call bDir.Create(bPathFolder)
						end if
						 Set bDir=nothing		          
						TextFile.Name=Path		          
						if TextFile.Exists() then
							TextFile.Delete()
						end if				
						TextFile.Name=PathOld	
						if TextFile.Exists() then
							Call TextFile.Copy (Path)				
						end if
						TextFile.Name=PathOld				
						if TextFile.Exists() then
							TextFile.Delete()
						end if				
						sSQL="Select * from vanban_noidung where mavanthu Like '"& ModiString(bID) &"' and Loaivanthu='4'  order by Sothutu"
						Set RecRename=server.CreateObject("ADODB.Recordset")
						RecRename.CursorType=3
						RecRename.CacheSize=5
						RecRename.Open sSQL,Conn
						Set Ex=server.CreateObject("Vinalines.ClsFile")				
						Do while not RecRename.EOF					
							Pathold=RootContent & "Upload\"& Cstr(bNamcu) &"\noibo"
							Pathold=Pathold & "\" & bID & "S" & trim(cstr(RecRename("sothutu"))) & "." & Ex.GetExtensionFile(RecRename("Tentep"))			
							Path=RootContent & "Upload\"& Cstr(bNam) &"\noibo"
							Path=Path & "\" & bID & "S" & trim(cstr(RecRename("sothutu"))) & "." & Ex.GetExtensionFile(RecRename("Tentep"))			
							TextFile.Name=Path
							if TextFile.Exists() then
								TextFile.delete()
							end if
							TextFile.Name=PathOld
							if TextFile.Exists() then
								call TextFile.Copy (Path)
								TextFile.Delete()
							end if
							bName=bID & "S" & trim(cstr(RecRename("sothutu"))) & "." & Ex.GetExtensionFile(RecRename("Tentep"))
							sSQL="Update vanban_noidung set Tentep='"& bName &"' where loaivanthu='4' and   Sothutu="& RecRename("sothutu") &" And mavanthu like '"& ModiString(bID) &"'"
							Conn.Execute sSQL
							RecRename.MoveNext
						Loop
						RecRename.Close
						set RecRename=nothing
						set TextFile=nothing
						Set Ex=nothing
					end if
					if bQuyen then
						sSQL="Delete Quyen where maloaivanthu='3' and mavanthu like '"& ModiString(bSoghinhancu) &"'"
						Conn.Execute sSQL
						sSQL="Delete Quyen_nhom where maloaivanthu='3' and mavanthu like '"& ModiString(bSoghinhancu) &"'"
						Conn.Execute sSQL
					end if				
					if Err.number=0 then
						Conn.CommitTrans
						bTrangthailog=1
					else
						Conn.RollbackTrans
						bTrangthailog=0
					end if
					bNamcu=bNam
					bSoghinhancu=bSoghinhan
					'Ghi nhan Ai da login thanh cong				
					bTrangthailog=1
					bHoten=Session("bHoten")
					bNgaygio=cstr(Date()) &" "& cstr(Time())
					bChucnang="Cập nhật văn thư nội bộ"
					bIDTailieu=bSoghinhan
					bDongtac="Sửa"
					sSQL="insert into loguser(Tennguoisudung,ngaygio,chucnangdung,dongtac,IDTailieu,Trangthai) Values('"& bHoten _
						&"','"& bNgaygio &"','"& bChucnang &"','"& bDongtac &"','"& bIDTailieu &"',"& bTrangthailog &")"
					Conn.Execute sSQL					
				end if
			case "okadd"
				bSoghinhan=trim(Request("TxtSoghinhan"))
				bNam=year(Request("TxtNgaytao"))		
				if KTSoghinhan(bSoghinhan,"okadd") then
					Msg="M&#227; s&#7889; ghi nh&#7853;n &#273;&#227; t&#7891;n t&#7841;i"
					bTontai=True
					bDisplay=true
					bComm="add"
				else
					Msg="N&#7897;i dung c&#7853;p nh&#7853;t"
					bTonTai=false
					bComm="edit"
					bSoghinhancu=bSoghinhan
					bIDcu=bID
					bNamcu=bNam
				end if
				
	'			bSoghinhancu=bSoghinhan
				bTrichyeu=trim(Request("TxtTrichyeu"))
				bNguoitao=trim(Request("TxtNguoitao"))
				bNgaytao=request("TxtNgaytao")
				bTukhoa=trim(Request("TxtTukhoa"))
				bTrangthai=Request("bTrangthai")
'				bDiachiluutru=Request("TxtDiachiluutru")
				bDiachiluutru=0
				if bTrangthai then
					bTrangthai=1
				else
					bTrangthai=0
				end if
				bQuyen=Request("bQuyen")
				if bQuyen then
					bQuyen=1
				else
					bQuyen=0
				end if
				bVinhvien=Request("RButton")
				bThoihan=request("TxtThoihan")
				if not bTontai then
					if bVinhvien<>"" then
						bvinhvien=1
						bThoihan=savedate(bThoihan)
					else
						bVinhvien=0				
					end if			
					bTentep=bSoghinhan+".VT"
					bNgaytao=SaveDate(bNgaytao)
					if bVinhvien then							
						sSQL="Insert Into VTNoibo(soghinhan,trichyeu,diachiluutru,tentep,nguoiky,Quyen,trangthai,ngayky,tukhoa,vinhvien,thoihan) values('"& modistring(bSoghinhan) _
								&"','"& ModiString(bTrichyeu) _
								&"','"& ModiString(bDiachiluutru) _
								&"','"& ModiString(bTentep) &"','"& modistring(bNguoitao) _
								&"',"& bQuyen &","& bTrangthai _
								&",'"& bNgaytao &"','"& ModiString(bTukhoa) &"',"& bVinhvien &",'"& bThoihan &"')"
					else
						sSQL="Insert Into VTNoibo(soghinhan,trichyeu,diachiluutru,tentep,nguoiky,Quyen,trangthai,ngayky,tukhoa,vinhvien,thoihan) values('"& modistring(bSoghinhan) _
								&"','"& ModiString(bTrichyeu) _
								&"','"& ModiString(bDiachiluutru) _
								&"','"& ModiString(bTentep) &"','"& modistring(bNguoitao) _
								&"',"& bQuyen &","& bTrangthai _
								&",'"& bNgaytao &"','"& ModiString(bTukhoa) &"',"& bVinhvien &",NULL)"
					end if
					Conn.Execute sSQL
					'Ghi nhan Ai da login thanh cong				
					bTrangthailog=1
					bHoten=Session("bHoten")
					bNgaygio=cstr(Date()) &" "& cstr(Time())
					bChucnang="Cập nhật văn bản nội bộ"
					bIDTailieu=bSoghinhan
					bDongtac="Thêm mới"
					sSQL="insert into loguser(Tennguoisudung,ngaygio,chucnangdung,dongtac,IDTailieu,Trangthai) Values('"& bHoten _
						&"','"& bNgaygio &"','"& bChucnang &"','"& bDongtac &"','"& bIDTailieu &"','"& bTrangthailog &"')"					
					Conn.Execute sSQL			
					'Lay ID
					sSQL="select max(IDnoibo) as IDnoibo from VTNoibo order by IDNoibo"
					Set recID=server.CreateObject("ADODB.Recordset")
					RecID.CursorType=3
					RecID.CacheSize=5
					RecID.Open sSQL,conn
					bID=RecID("IDnoibo")
					if Session("VanBan")="" then 
						Session("VanBan")="-" & Session("VanBan") & bID &"-"
					else
						Session("VanBan")=Session("VanBan") & bID &"-"
					end if
					RecID.Close
					Set RecID=nothing
					
					Set RecTemp=Server.CreateObject("ADODB.Recordset")				
				'************************* Chuyen thanh van ban noi bo
					if bDangky="ok" then
						set Obj=server.CreateObject("ActiveFile.File")
						IDFlow=Request("IDFLow")
						sSQL="Select Tentepxuly from workflow where maworkflow like '"& IDFlow &"'"
						Set RecTT=server.CreateObject("ADODB.Recordset")
						RecTT.CursorType=3
						RecTT.CacheSize=5
						RecTT.Open sSQL,Conn
						if RecTT.RecordCount then
							tentep=RecTT("Tentepxuly")
						end if
						RecTT.Close
						Set RecTT=nothing
						'Path1=RootContent & "Data\yeucau\TEXT"  & "\"& tentep
						IDFlow=request("IDFlow")
						Path1=RootContent & "Data\yeucau\TEXT"  & "\"& IDFlow & ".VT"
						obj.Name=Path1
						fname=bID & ".VT"
						
						'Tao thu muc nam moi
						Set bDir=server.CreateObject("ActiveFile.Directory")
						 bPathFolder=RootContent & "Upload" & "\" & bNam
						bDir.Path=bPathFolder
						if not bDir.Exists() then
							call bDir.Create(bPathFolder)
						end if
						bPathFolder=bPathFolder & "\noibo"
						bDir.Path=bPathFolder
						if not bDir.Exists() then
							Call bDir.Create(bPathFolder)
						end if
							bPathFolder=bPathFolder & "\Text"
							bDir.Path=bPathFolder
							if not bDir.Exists() then
								Call bDir.Create(bPathFolder)
						end if
						 Set bDir=nothing
						if obj.Exists() then
							obj.Name=RootContent & "upload\"& bNam &"\noibo\TEXT\"& fname
							if obj.Exists() then
								obj.Delete()
							end if
							Obj.Name=Path1						
							Path2=RootContent & "upload\"& bNam &"\noibo\TEXT\"& fname
							Obj.Copy(Path2)
							bTentep=fname
						else
							loi=true
						end if
							
						Set TextFile=server.CreateObject("Vinalines.ClsFile")
						'Save HTML		
						sSQL="Select Tentep,mota from workflow_tentep where maworkflow like '"& IDFlow &"'"					
						Set RecWF=server.CreateObject("ADODB.Recordset")
						RecWF.CursorType=3
						RecWF.CacheSize=5
						RecWF.Open sSQL,Conn	
						if RecWF.RecordCount then					
							STT=0
							Do while not RecWF.EOF
								STT=STT+1
								Tentep=bID & "S" & cstr(STT) & "." &TextFile.GetExtensionFile(RecWF("Tentep"))
								P1=RootContent & "Data\yeucau" & "\" & RecWF("Tentep")
								Obj.Name=P1						
								if Obj.Exists() then
									P2=RootContent & "upload\"& bNam &"\noibo\"& Tentep
									Obj.Copy(P2)
								end if
								sSQL="Insert into vanban_Noidung(Mavanthu,Loaivanthu,SoThutu,tentep,mota) values('"& bID &"','4',"& cstr(STT) &",'"& tentep &"','"& RecWF("mota") &"')"
								Conn.Execute sSQL
								RecWF.MoveNext
							Loop
						end if
						RecWF.Close
						Set RecWF=nothing
						Set TextFile=nothing
						set Obj=nothing
					end if
				end if
		end select
end if
%>	
<!--#include file="..\jvfunction.inc"-->
<script language=vbscript runat=server>
'******Giai ma xau************************
	Function GiaiMa(msText) 
	    Dim nC
	    Dim nD
	    Dim nE
	    Dim lA
	    Dim lB
	    Dim lI
	    Dim lJ
	    Dim lK
	    Dim sB
	    lA = Len(msText)
	    lB = lA - 1 - (lA - 1) \ 4
	    sB = Space(lB)
	    For lI = 1 To lB
	        lJ = lJ + 1
	        nC = Asc(Mid(msText, lJ, 1)) - 59	        
	        Select Case lI Mod 3
	        Case 1
	            lK = lK + 4
	            If lK > lA Then lK = lA
	            nE = Asc(Mid(msText, lK, 1)) - 59
	            nD = ((nE \ 16) And 3) * 64
	        Case 2
	            nD = ((nE \ 4) And 3) * 64
	        Case 0
	            nD = (nE And 3) * 64
	            lJ = lJ + 1
	        End Select
	        sB=Mid(sB,1,lI-1) & Chr(nC Or nD) & Mid(sB,lI+1,len(sB)-lI)
	    Next
	    GiaiMa = sB
	End Function
	Function SaveDate(vDate)
		dim bvitri1
		dim bvitri2
	   vDate=trim(cstr(vDate))
	   bvitri1=instr(1,vDate,"/")
	   bMonth=left(vDate,bvitri1-1)
	   bvitri2=instr(bvitri1+1,vDate,"/")
	   Dim Temp
	   Temp=right(vDate,len(vDate)-bvitri1)
	   bDay=left(Temp,bvitri2-bvitri1-1)
	   bYear=right(vDate,len(vDate)-bvitri2)
       SaveDate=bDay+"/"+bMonth+"/"+bYear
	End Function
	' H&#224;m &#273;&#7883;nh d&#7841;ng l&#7841;i ng&#224;y M/D/Y-> D/M/Y		
	Function FormatDate(vDate)
	   If Not IsNull(vDate) Then
	        vM = Right("0" & Month(vDate), 2)
	        vD = Right("0" & Day(vDate), 2)
	        vY = Right("19" & Year(vDate), 4)
	        FormatDate = vD & "/" & vM & "/" & vY
	   End If
	End Function
	Function ModiString(mess_s)
		message = Replace("" & mess_s,"'", "''")
		ModiString=message
	End function
	'Kiem tra so ghi nhan
	Function KTSoghinhan(bValue,loai)
		KTSoghinhan=false
		if loai="okedit" then
			bSoghinhancu=request("bSoghinhancu")
			if bValue<>bSoghinhancu then
				sSQL="Select Soghinhan from vtnoibo where Soghinhan like '"& Modistring(bValue) &"'"
				set RecKT=server.CreateObject("ADODB.Recordset")
				RecKT.CursorType=3
				RecKT.CacheSize=5
				RecKT.Open sSQL,Conn
				if (not RecKT.BOF) and (not RecKT.EOF) then
					KTSoghinhan=true
				end if
				RecKT.Close
				set RecKT=nothing				
			end if
		end if
		if loai="okadd" then
			sSQL="Select Soghinhan from vtnoibo where Soghinhan like '"& Modistring(bValue) &"'"
			set RecKT=server.CreateObject("ADODB.Recordset")
			RecKT.CursorType=3
			RecKT.CacheSize=5
			RecKT.Open sSQL,Conn
			if (not RecKT.BOF) and (not RecKT.EOF) then
				KTSoghinhan=true
			end if
			RecKT.Close
			set RecKT=nothing				
		end if			
	end function
</script>	
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function RButton_click() {
	if(Noidung.RButton.checked){
		Noidung.TxtThoihan.value="<%=formatdate(Date()+180)%>"
	}
	else{
		Noidung.TxtThoihan.value="";
	}
}
function CmdExit_onclick() {
	<%if bdangky="ok" then%>
		window.history.go(-<%=backform%>);
	<%else%>
		window.Noidung.target="right";
		window.Noidung.action="frmdsvtnoibo.asp?bComm=";
		window.Noidung.submit();
	<%end if%>
}
function CmdDuyet_onclick() {
	<%if bComm="add" then %>
		alert("Bạn cần phải cập nhật văn thư trước");
		return false;
	<%end if%>
	if (!Noidung.CheckReadwrite.Checked){
	<%if bQuyen then %>
		alert("Bạn cần phải cập nhật văn thư trước");
		return false;
	<%end if%>
	}
	mavt="<%=bSoghinhan%>"
	window.Noidung.target="right";
	bduyet="duyetcanbo.asp?bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bstepduyet=0&bCommDuyetCB="+'<%=bComm%>'+"&MaVT="+mavt+"&bMaLoaiVT=3";
	window.Noidung.action=bduyet
	window.Noidung.submit();
}
function CmdAdd_onclick() {
	<%if bdangky="ok" then%>		
		window.Noidung.action="frmvtnoibo.asp?FilenameChuyen="+"<%=request("Filenamechuyen")%>"+"&bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bComm=add";
	<%else%>
		window.Noidung.action="frmvtnoibo.asp?bComm=add";
	<%end if%>
	window.Noidung.target="right";
	window.Noidung.submit();
	//window.navigate("frmvtnoibo.asp?bComm=add");
}
function KTNhap(){
	if (trim(Noidung.TxtSoghinhan.value)==""){
		alert("Bạn cần phải nhập số, ký hiệu");
		Noidung.TxtSoghinhan.focus();
		return false;
	}
	if(daucach(Noidung.TxtSoghinhan.value)){
		alert("Số, ký hiệu không được chứa các ký tự đặc biệt(',space)");
		Noidung.TxtSoghinhan.focus();
		return false;
	}
	if (trim(Noidung.TxtTrichyeu.value)==""){
		alert("Cho biết trích yếu nội dung");
		Noidung.TxtTrichyeu.focus();
		return false;
	}
	if (!isDate(Noidung.TxtNgaytao.value)){
		alert("Ngày tạo không hợp lệ");
		Noidung.TxtNgaytao.focus();
		return false;
	}
/*	if (trim(Noidung.TxtDiachiluutru.value)==""){
		alert("Cho biết địa chỉ lưu trữ");
		Noidung.TxtDiachiluutru.focus();
		return false;
	}	
*/
	if (trim(Noidung.TxtNguoitao.value)==""){
		alert("Cho biết người tạo");
		Noidung.TxtNguoitao.focus();
		return false;
	}
	if (Noidung.RButton.checked){
		if(trim(Noidung.TxtThoihan.value)=="" || !isDate(Noidung.TxtThoihan.value)){
			alert("Ngày không hợp lệ");
			Noidung.TxtThoihan.focus();	
			return false;
		}		
	}	
	return true;
}

function CmdOK_onclick() {
	if (KTNhap()){
		<%if bComm="edit" then%>
			window.Noidung.target="right"			
			window.Noidung.action="frmVTNoibo.asp?IDFlow="+"<%=request("IDFLow")%>"+"&bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bComm=okedit&bSoghinhancu="+"<%=bSoghinhancu%>"+"&bNamcu="+"<%=bNamcu%>"+"&bQuyen="+Noidung.CheckReadwrite.checked+"&bTrangthai=" + "<%=bTrangthai%>"		
			window.Noidung.submit()
		<%end if%>
		<%if bComm="add" then%>
			window.Noidung.target="right"
			<%if bDangky="ok" then%>
				act="frmVTNoibo.asp?IDFlow="+"<%=request("IDFLow")%>"+"&bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bComm=okadd"+"&bNamcu="+"<%=bNamcu%>"+"&bQuyen="+Noidung.CheckReadwrite.checked+"&bTrangthai=false"
				window.Noidung.action=act;
			<%else%>
				window.Noidung.action="frmVTNoibo.asp?bComm=okadd"+"&bNamcu="+"<%=bNamcu%>"+"&bQuyen="+Noidung.CheckReadwrite.checked+"&bTrangthai=false"
			<%end if%>
			window.Noidung.submit()
		<%end if%>
	}
}
function CmdOKDuyet_onclick() {
	<%if bComm="add" then %>
		alert("Bạn cần phải ghi nhận trước");
		return false;
	<%end if%>
	if (KTNhap()){
		<%if bComm="edit" then%>
			window.Noidung.target="right"			
			window.Noidung.action="frmVTNoibo.asp?bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bNamcu="+"<%=bNamcu%>"+"&bComm=okedit&bSoghinhancu="+"<%=bSoghinhancu%>"+"&bQuyen="+Noidung.CheckReadwrite.checked+"&bTrangthai=true"
			window.Noidung.submit()
		<%end if%>
	}
}
function CmdNotOKDuyet_onclick() {
	<%if bComm="add" then %>
		alert("Bạn cần phải ghi nhận trước");
		return false;
	<%end if%>
	if (KTNhap()){
		<%if bComm="edit" then%>
			window.Noidung.target="right"			
			window.Noidung.action="frmVTNoibo.asp?bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bNamcu="+"<%=bNamcu%>"+"&bComm=okedit&bSoghinhancu="+"<%=bSoghinhancu%>"+"&bQuyen="+Noidung.CheckReadwrite.checked+"&bTrangthai=false"
			window.Noidung.submit()
		<%end if%>
	}
}
function CmdXacnhan_onclick() {
	if(Noidung.TxtPsw.value=="<%=Giaima(Session("Pass"))%>"){
		if(Noidung.CheckDuyet.disabled){
			Noidung.CheckDuyet.disabled=false;
			Noidung.CmdNoidungtep.disabled=false;}
		else{
			Noidung.CheckDuyet.disabled=true;
			Noidung.CmdNoidungtep.disabled=true;
		}
			return true
	}
	else{
		alert("B&#7841;n x&#225;c nh&#7853;n sai m&#7853;t kh&#7849;u !")
		return false;
	}	
	Noidung.TxtPsw.value="";
}
function CmdXemNoidung_onclick() {
	<%if bComm="add" then %>
		alert("Bạn cần phải ghi nhận trước");
		return false;
	<%end if%>
	if (Noidung.TxtSoghinhan.value!=""){
		window.Noidung.target="_blank";
		bMa=Noidung.bID.value;
		window.Noidung.action="xemnoidung.asp?LoaiVt=4&bMa="+bMa+"&bNam="+"<%=bNam%>"
		window.Noidung.submit();
	}
}
function CmdNoidungtep_onclick() {
	<%if bComm="add" then %>
		alert("Bạn cần phải ghi nhận trước");
		return false;
	<%end if%>
	<% if bComm="edit" then%>
		bMa=Noidung.bID.value;
		a="../editor/frmedit.asp?bMa="+bMa+"&bLoaiVT=4&bNam="+"<%=bNam%>"+"&bNamcu="+"<%=bNamcu%>";
		window.Noidung.action=a;
		window.Noidung.target="right";
		window.Noidung.submit();
	<%end if%>
		//window.Noidung.target="right"
		//window.Noidung.action="upload.asp?bDangky="+"<%=bDangky%>"+"&Backform="+"<%=backform%>"+"&bMaVt="+"<%=bSoghinhan%>"+"&LoaiVt=noibo&filename="+Noidung.TxtTenTep.value;
		//window.Noidung.action=a;
		//window.Noidung.submit();
}
function ComboNguoiky_onchange() {
	Noidung.TxtNguoitao.value=Noidung.ComboNguoiky.value;
}
function CheckReadwrite_onclick(){
	if (Noidung.CheckReadwrite.checked){
		Noidung.CmdDuyet.disabled=true;
		CmdOK_onclick();
	}		
	else{
		Noidung.CmdDuyet.disabled=false;
		CmdOK_onclick();
	}
}

function TxtNgaytao_onkeyup(str){
var keycode
keycode=window.event.keyCode
if (isEdit(keycode,str)){
	Noidung.TxtNgaytao.value=editdate(trim(str))
}
}

function TxtThoihan_onkeyup(str){
var keycode
keycode=window.event.keyCode
if (isEdit(keycode,str)){
	Noidung.TxtThoihan.value=editdate(trim(str))
}
}

function CmdWorklow_onclick()
{
	if (!KTNhap())
	{
	return false;
	}
	if(!confirm("Bạn có muốn tạo luồng xử lý ?")){
	  return false;
	}
	window.Noidung.target="right";
	window.Noidung.action="../workflow/createworkflow.asp?bComm=vtnoibo";
	window.Noidung.submit();
}
	
//-->
</SCRIPT>
<body bgcolor=#F8F9D9 topmargin="0" leftmargin="0" style="font-family:times new roman">
<%if Msg<>"" then%>
	<p align=center><font color=red><%=Msg%></p>
<%end if%>	
<form name=Noidung method=post>
<%if bComm="edit" then%>
	<input type=hidden name=bID value='<%=bID%>'>
<%else%>
	<input type=hidden name=bID>
<%end if%>

<table border="0" cellspacing="0" style="font-size:12pt;BORDER-BOTTOM-STYLE: none; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid;border-collapse:collapse; border-left-color:#C0C0C0; border-right-color:#C0C0C0; border-top-color:#C0C0C0; border-bottom-color:#C0C0C0" width="100%" bgcolor="#BDD5D0">
  <tr>
    <td width="100%" colspan="5" bgcolor="#000080">
    <p align="center"><font color="#FFFFFF"><span style="font-size: 11pt">VĂN 
    BẢN NỘI BỘ</span></font></td>
  </tr>
  <tr>
    <td width="15%">Số, ký hiệu</td>
	<td width="85%" colspan="4">
	<%if bDisplay then%>
		<input name='TxtSoghinhan' value='<%= bSoghinhan %>' maxlength=20 style='font-family:Arial; width:100%' size="20"></td>
	<%else
		if bComm<>"add" then%>
			<input name='TxtSoghinhan' value='<%= bSoghinhan %>' maxlength=20 style='font-family:Arial; width:100%'></td>
		<%else%>
			<input name='TxtSoghinhan' maxlength=20 style='font-family:Arial; width:100%'></td>
		<%end if
	end if
	%>    
  </tr>
  <tr>
    <td width="15%">Trích yếu</td>
    <%if bDisplay then%>
		<td width="85%" colspan="4">
        <textarea name=TxtTrichyeu maxLength=255 style='font-family:Arial; width:100%' rows=1 cols=82><%= bTrichyeu %></textarea></td>
	<%else
		if bComm<>"add" then%>
			<td width="85%" colspan="4">
            <textarea name=TxtTrichyeu maxLength=255 style='font-family:Arial; width:100%' rows=1 cols=82><%= bTrichyeu %></textarea></td>
		<%else
			if Request("ChuyenVTNoibo")="ok" then
				Set RecTY=server.CreateObject("ADODB.Recordset")
				RecTY.CursorType=3
				RecTY.CacheSize=5
				sSQL="Select Tenvuviec from workflow where Maworkflow like '"& Request("IDFlow") &"'"
				RecTY.Open sSQL,Conn
				if RecTY.RecordCount then
					if trim(RecTY("Tenvuviec"))<>"" then%>
						<td width="85%" colspan="4">
                        <textarea name=TxtTrichyeu maxLength=255 style='font-family:Arial; width:100%' rows=1 cols=82><%= RecTY("Tenvuviec")%></textarea></td>
					<%else %>
						<td width="85%" colspan="4">
                        <textarea name=TxtTrichyeu maxLength=255 style='font-family:Arial; width:100%' rows=1 cols=82></textarea></td>					
					<%end if
				else%>
					<td width="85%" colspan="4">
                    <textarea name=TxtTrichyeu  maxLength=255 style='font-family:Arial; width:100%' rows=1 cols=82></textarea></td>
				<%end if
				RecTY.Close
				set RecTY=nothing
			else%>			
				<td width="85%" colspan="4">
                <textarea name=TxtTrichyeu  maxLength=255 style='font-family:Arial; width:100%' rows=1 cols=82></textarea></td>
			<%end if
		end if
	end if%>    
  </tr>
  <tr>
    <td width="15%">Ngày tạo</td>
	<td width="20%">
	<%if bDisplay then%>
		<input name=TxtNgaytao value='<%=formatdate(bNgayTao)%>' size=10 maxLength=10 style='font-family:Arial' LANGUAGE=javascript onkeyup="return TxtNgaytao_onkeyup(this.value)" style="width:100%"></td>
	<%else
		if bComm<>"add" then%>
			<input name=TxtNgaytao value='<%=formatdate(bNgayTao)%>' size=10 maxLength=10 style='font-family:Arial' LANGUAGE=javascript onkeyup="return TxtNgaytao_onkeyup(this.value)" style="width:100%"></td>
		<%else%>
			<input name=TxtNgaytao value='<%=formatdate(Date())%>' size=10 maxLength=10 style='font-family:Arial' LANGUAGE=javascript onkeyup="return TxtNgaytao_onkeyup(this.value)" style="width:100%"></td>
		<%end if
	end if%>    
    <td width="15%" align=center>Người tạo</td>
    <td width="20%"><input name=TxtNguoitao value='<%=bNguoitao %>' size=19 style='font-family:Arial; width:100%' ></td>
    <%
		'Lay Ten Nguoi tao
		sSQL="Select Hovaten from canbo"
		Set RecCB=server.CreateObject("ADODB.Recordset")
		RecCB.CursorType=3
		RecCB.CacheSize=5
		RecCB.Open sSQL,Conn
		%>
		<td width="20%">
			<select size=1 name=ComboNguoiky style='font-family:arial;width:100%' LANGUAGE=javascript onchange='return ComboNguoiky_onchange()'>
			<option value='' selected>
		<%
		Do While not RecCB.EOF
			%><option value='<%=RecCB("Hovaten")%>'><%=RecCB("Hovaten")%><%
			RecCB.MoveNext
		Loop
		txt="</select>"
		Response.Write(txt)
		RecCB.Close
		Set RecCB=nothing
	%>    
    </td>
  </tr>
  <tr>
    <td width="15%">Từ khóa</td>
	<td width="85%" colspan="4">
	<%if bDisplay then%>
		<input name=TxtTukhoa value='<%= bTukhoa %>' maxLength=100  style='font-family:Arial; width:100%' size="20"></td>
	<%else
		if bComm<>"add" then%>
			<input name=TxtTukhoa value='<%= bTukhoa %>' maxLength=100  style='font-family:Arial; width:100%'></td>
		<%else%>
			<input name=TxtTukhoa maxLength=100  style='font-family:Arial; width:100%'></td>		
		<%end if
end if%>    
  </tr>
<!--
  <tr>
    <td width="15%">Địa chỉ lưu trữ</td>
    <td width="85%" colspan="4">	
    <%
   		sSQL="Select * from Diachiluutru"
		Set RecCB=server.CreateObject("ADODB.Recordset")
		RecCB.CursorType=3
		RecCB.CacheSize=5
		RecCB.Open sSQL,Conn%>
		<select size=1 name=TxtDiachiluutru style='width:100%;font-family:arial'>		
		<%Do While not RecCB.EOF				
				if bDisplay then
					if trim(cstr(RecCB("IDLuutru")))=trim(bDiachiluutru) then		
		%>				<option Selected value=<%=RecCB("IDLuutru")%>><%=RecCB("Ten")%>
		<%			else%>
						<option value=<%=RecCB("IDLuutru")%>><%=RecCB("Ten")%>
		<%			end if
				else%>
					<%if bComm<>"add" then
						if trim(cstr(RecCB("IDLuutru")))=trim(bDiachiluutru) then		
		%>					<option Selected value=<%=RecCB("IDLuutru")%>><%=RecCB("Ten")%>
		<%				else%>
							<option value=<%=RecCB("IDLuutru")%>><%=RecCB("Ten")%>
		<%				end if
					else%>
						<option value=<%=RecCB("IDLuutru")%>><%=RecCB("Ten")%>
					<%end if%>
		<%		end if
				RecCB.MoveNext
		Loop
		txt="</select>"
		Response.Write(txt)
		RecCB.Close
		Set RecCB=nothing%>
</td>
  </tr>

  -->
  <tr>
    <td width="15%"><label for=C1>Thời hạn xóa</label></td>
	<td width="65%" colspan=2>
    <%if bDisplay then
		if bVinhvien then%>
			<input name=RButton type=checkbox checked  LANGUAGE='javascript' onclick='return RButton_click()' value="ON" id=C1>
    		<input type=text name=TxtThoihan value="<%= formatdate(bThoihan) %>" size=15 maxLength=10 LANGUAGE=javascript onkeyup="return TxtThoihan_onkeyup(this.value)"></td>
		<%else%>
			<input name=RButton type=checkbox LANGUAGE='javascript' onclick='return RButton_click()' value="ON" id=C1>
    		<input type=text name=TxtThoihan size=15 maxLength=10 LANGUAGE=javascript onkeyup="return TxtThoihan_onkeyup(this.value)></td>
		<%end if							
	else	
		if bComm<>"add" then	
			if bVinhvien then%>
				<input name=RButton type=checkbox checked  LANGUAGE='javascript' onclick='return RButton_click()' value="ON" id=C1>
	    		<input type=text name=TxtThoihan value="<%= formatdate(bThoihan) %>" size=15 maxLength=10 LANGUAGE=javascript onkeyup="return TxtThoihan_onkeyup(this.value)"></td>
			<%else%>
				<input name=RButton type=checkbox LANGUAGE='javascript' onclick='return RButton_click()' value="ON" id=C1>
	    		<input type=text name=TxtThoihan size=15 maxLength=10 LANGUAGE=javascript onkeyup="return TxtThoihan_onkeyup(this.value)"></td>
			<%end if								
		else%>
			<input name=RButton type=checkbox LANGUAGE='javascript' onclick='return RButton_click()' value="ON" id=C1>
    		<input type=text name=TxtThoihan size=15 maxLength=10 LANGUAGE=javascript onkeyup="return TxtThoihan_onkeyup(this.value)"></td>
		<%end if
	end if%>    
    <td width="20%" colspan=2>
    <%  if bDisplay then
		if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),7)="1" or Session("IsAdmin") then%> 
			<Button name="CmdWorklow" style="font-family:Arial;width: 49%"  LANGUAGE=javascript onclick="return CmdWorklow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng xử lý</p></Button>
		<%else%>
			<Button name="CmdWorklow" disabled style="font-family:Arial;width: 49%"  LANGUAGE=javascript onclick="return CmdWorklow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng xử lý</p></Button>
		<%end if%>
	<%else
		if bComm<>"add" then %>
			<%if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),7)="1" or Session("IsAdmin") then%> 
				<Button name="CmdWorklow" style="font-family:Arial;width: 49%"  LANGUAGE=javascript onclick="return CmdWorklow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng xử lý</p></Button>
			<%else%>
				<Button name="CmdWorklow" disabled style="font-family:Arial;width: 49%"  LANGUAGE=javascript onclick="return CmdWorklow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng xử lý</p></Button>
			<%end if%>
		<%else%>
			<Button name="CmdWorklow" disabled style="font-family:Arial;width: 49%"  LANGUAGE=javascript onclick="return CmdWorklow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng xử lý</p></Button>
		<%end if
	end if%>
    <Button name="CmdOK" style="font-family:Arial;width: 49%"  LANGUAGE=javascript onclick="return CmdOK_onclick()" accesskey="G"><p><u>G</u>hi nhận</p></Button>
    </td>
  </tr>
</table>
<!-- Quy dinh quyen, Soan noi dung van thu -->
<table border="0" cellspacing="1" style="font-size:12pt;BORDER-BOTTOM-STYLE: solid; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid;border-collapse:collapse; border-left-color:#C0C0C0; border-right-color:#C0C0C0; border-top-color:#C0C0C0; border-bottom-color:#C0C0C0" width="100%" bordercolor="#111111" bgcolor="#BDD5D0">
<tr>
	<td width="50%" colspan="2" align="center" bgcolor="#000080">
    <font color="#FFFFFF"><b>Quy định quyền văn bản</b></font></td>
	<td width="25%" align="center" bgcolor="#000080"><font color="#FFFFFF"><b>Nội dung văn bản</b></font></td>
	<td width="25%" align="center" bgcolor="#000080"><font color="#FFFFFF"><b>Chức năng</b></font></td>
</tr>
<tr>
	<td width="25%" align=center><label for=C2 accesskey="C"><u>C</u>ho phép công bố</label>
	<%	
		if bDisplay then
			if  bQuyen then
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
					<input type=checkbox name=CheckReadwrite Checked language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
				<%else%>
					<input type=checkbox name=CheckReadwrite disabled  language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
				<%end if
			else
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
					<input type=checkbox name=CheckReadwrite language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
				<%else%>
					<input type=checkbox name=CheckReadwrite disabled language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
				<%end if
			end if
		else
			if bComm<>"add" then
				if  bQuyen then
					if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
						<input type=checkbox name=CheckReadwrite Checked language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
					<%else%>
						<input type=checkbox name=CheckReadwrite disabled  language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
					<%end if
				else
					if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
						<input type=checkbox name=CheckReadwrite language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
					<%else%>
						<input type=checkbox name=CheckReadwrite disabled  language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
					<%end if
				end if
			else
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
					<input type=checkbox name=CheckReadwrite language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
				<%else%>
					<input type=checkbox name=CheckReadwrite disabled  language=javascript onclick='return CheckReadwrite_onclick()' value="ON" id=C2></td>
				<%end if
			end if		'if bComm<>add
		end if
		%>
		<%  if bDisplay then
				if bQuyen then%>
					<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
				<%else
					if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
						<td width="25%"><Button name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
					<%else%>
						<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
					<%end if %>
				<% end if
			else
				if bComm<>"add" then
					if  bQuyen then%>
						<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
					<%else
						if session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then %>	
							<td width="25%"><Button name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
						<%else%>
							<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
						<%end if%>
					<% end if
				else
					if bComm="add" then							
						if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then %>	
							<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
						<%else%>
							<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
						<%end if
					else
						if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then %>	
							<td width="25%"><Button name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()' accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
						<%else%>
							<td width="25%"><Button disabled name='CmdDuyet' style='font-family: Arial;width: 100%' LANGUAGE=javascript onclick='return CmdDuyet_onclick()'accesskey="Q"><p><u>Q</u>uy định quyền</p></Button></td>
						<%end if
					end if
				end if
			end if%>	<!--if bDisplay-->
	<%if bComm="add" then%>		
		<td width="25%"><Button disabled name="CmdXemNoidung" style="font-family: Arial;width: 100%" LANGUAGE=javascript onclick="return CmdXemNoidung_onclick()" accesskey="X"><p><u>X</u>em nội dung văn bản</p></Button></td>
	<%else%>
		<td width="25%"><Button name="CmdXemNoidung" style="font-family: Arial;width: 100%" LANGUAGE=javascript onclick="return CmdXemNoidung_onclick()" accesskey="X"><p><u>X</u>em nội dung văn bản</p></Button></td>
	<%end if%>
	<td width="25%"><Button name="CmdAdd" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdAdd_onclick()" accesskey="T"><p><u>T</u>hêm mới</p></Button></td>
</tr>
<tr>
	<%if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
		<%if bComm="add" then%>
			<%if bTrangthai then%>
				<td width="25%"><Button disabled name="CmdOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdOKDuyet_onclick()" accesskey="D"><p><u>D</u>uyệt nội dung</p></Button></td>
			<%else%>
				<td width="25%"><Button disabled name="CmdOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdOKDuyet_onclick()" accesskey="D"><p><u>D</u>uyệt nội dung</p></Button></td>
			<%end if%>
		<%else%>
			<%if bTrangthai then%>
				<td width="25%"><Button disabled name="CmdOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdOKDuyet_onclick()" accesskey="Đ"><p><u>D</u>uyệt nội dung</p></Button></td>
			<%else%>
				<td width="25%"><Button name="CmdOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdOKDuyet_onclick()" accesskey="D"><p><u>D</u>uyệt nội dung</p></Button></td>
			<%end if%>
		<%end if%>
	<%else%>					
		<td width="25%"><Button disabled name="CmdOKDuyet" style="font-family: Arial;width: 100%" LANGUAGE=javascript onclick="return CmdOKDuyet_onclick()" accesskey="D"><p><u>D</u>uyệt nội dung</p></Button></td>
	<%end if%>
	<%if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
		<%if bTrangthai then%>
			<td width="25%"><Button name="CmdNotOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdNotOKDuyet_onclick()" accesskey="H"><p><u>H</u>ủy duyệt nội dung</p></Button></td>
		<%else%>
			<td width="25%"><Button disabled=true name="CmdNotOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdNotOKDuyet_onclick()" accesskey="H"><p><u>H</u>ủy duyệt nội dung</p></Button></td>
		<%end if%>
	<%else%>
		<td width="25%"><Button disabled=true name="CmdNotOKDuyet" style="font-family: Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdNotOKDuyet_onclick()" accesskey="H"><p><u>H</u>ủy duyệt nội dung</p></Button></td>
	<%end if%>
	<%if bComm="add" then%>
		<%if bTrangthai then%>
			<td width="25%"><Button name="CmdNoidungtep" style=" font-family: Arial; height: 25; position: relative; width: 100%" LANGUAGE=javascript onclick="return CmdNoidungtep_onclick()" accesskey="S"><p><u>S</u>oạn nội dung văn bản</p></Button></td>
		<%else%>
			<td width="25%"><Button disabled  name="CmdNoidungtep" style=" font-family: Arial; height: 25; position: relative; width: 100%" LANGUAGE=javascript onclick="return CmdNoidungtep_onclick()" accesskey="S"><p><u>S</u>oạn nội dung văn bản</p></Button></td>
		<%end if%>
	<%else%>
		<%if bTrangthai then%>
			<td width="25%"><Button disabled name="CmdNoidungtep" style=" font-family: Arial; height: 25; position: relative; width: 100%" LANGUAGE=javascript onclick="return CmdNoidungtep_onclick()" accesskey="S"><p><u>S</u>oạn nội dung văn bản</p></Button></td>
		<%else%>
			<td width="25%"><Button name="CmdNoidungtep" style="font-family: Arial;  height: 25; position: relative; width: 100%" LANGUAGE=javascript onclick="return CmdNoidungtep_onclick()" accesskey="S"><p><u>S</u>oạn nội dung văn bản</p></Button></td>
		<%end if%>
	<%end if%>		
	<td width="25%"><Button name="CmdExit" style="font-family: Arial;width: 100%" LANGUAGE=javascript onclick="return CmdExit_onclick()" accesskey="Y"><p>Qua<u>y</u> lại</p></Button></td>
</tr>
</table>
</form>
</font>
</body>
</html>
<%
	Conn.Close
	set Conn=nothing
%>